package com.pox.guli.service.trade.util;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

/**
 * 订单号再生成
 * @Author PoX21s
 * @Date: 2022/1/6 14:45
 * @Version 1.0
 */

public class OrderNoUtils {

    /**
     * 获取订单号
     */
    public static String getOrderNo() {

        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
        String newDate = sdf.format(new Date());
        StringBuilder result = new StringBuilder();
        Random random = new Random();
        for (int i = 0; i < 3; i++) {
            result.append(random.nextInt(10));
        }

        return newDate + result;
    }

}
